home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD018b.dsk
/
SUB.DRILL.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
8KB
|
248 lines
1 REM ADDITION DRILL AND PRACTICE
2 REM COPYRIGHT (C) 1982 - JOHN BEIDLER
3 REM MAY BE DUPLICATED FOR
4 REM EDUCATIONAL PURPOSES BUT
5 REM NOT FOR RESALE
10 DIM A(10),P(10,10)
15 GOSUB 4000
20 GOSUB 7000: REM INITIALIZE
30 GOSUB 2000: REM MAIN PROCEDURE
40 GOSUB 4000: REM MARQUE WRAPUP
50 PRINT D$;"RUN START.DRILLS"
99 END
300 REM FILE THE PROBLEM
305 X5 = X5 +1
310 GOSUB 1100
320 PRINT "S": PRINT P
330 FOR I5 = 0 TO N0 -1
335 FOR J5 = 0 TO S0 -1
340 PRINT P(I5,J5)
350 NEXT J5: NEXT I5
390 GOSUB 1150
399 RETURN
500 REM ERROR IN ANSWER
501 GOSUB 7150
505 IF R0 = 0 THEN E(1) = E(1) +1
506 IF R0 < >0 THEN E(3) = E(3) +1
507 VTAB 12 +N0 +3: HTAB 10
508 INVERSE : PRINT "THAT IS WRONG";: NORMAL
510 IF X0 = 0 THEN X0 = 1: GOSUB 300
520 GOSUB 1100
530 PRINT "A": PRINT I: PRINT A9
540 GOSUB 1150
547 VTAB 12 +N0 +3: HTAB 10: PRINT " ";
549 VTAB 12 +N0 +1: HTAB 20 +S0 -2 *I
550 IF R0 = R9 THEN A9 = A(I): GOTO 633
555 VTAB 12 +N0 +3: HTAB 10
565 NORMAL : HTAB 10: PRINT " TRY AGAIN";: GOSUB 1200
570 HTAB 10: PRINT " "
598 R0 = R0 +1
599 GOTO 615
600 REM PROBLEM DRILL PROCEDURE
605 X0 = 0: REM ERROR THIS PROBLEM
610 FOR I = 0 TO S0
611 IF (I = S0) AND (A(I) = 0) THEN 680
612 R0 = 0
615 VTAB 12 +N0 +1: HTAB 20 +S0 -2 *I
620 GET A$: IF (A$ <"0") OR (A$ >"9") THEN 620
625 A9 = ASC(A$) - ASC("0")
630 IF A9 < >A(I) THEN 500
632 GOSUB 7100
633 R0 = 0
635 PRINT A9
636 IF I = S0 THEN 680
680 NEXT I
698 GOSUB 1200
699 RETURN
700 REM DRILL INITIALIZATION
705 X5 = 0
710 FOR I = 0 TO 4:E(I) = 0: NEXT I
799 RETURN
800 REM SET UP A PROBLEM
801 HOME : VTAB 2: HTAB 1
802 PRINT "PROBLEM NO. ";P;" OF ";M9
803 VTAB 23: PRINT "ENTER THE DIGIT INDICATED BY THE ";: FLASH : PRINT " ";: NORMAL
804 VTAB 2: HTAB 27: PRINT "SUBTRACTION"
805 P(N0,0) = 0
810 FOR J = 0 TO S0 -1
815 A(J) = P(N0,J)
820 FOR I = 0 TO N0 -1
830 P(I,J) = INT(10 * RND(1))
831 IF I = 0 THEN P(I,J) = -P(I,J)
835 A(J) = A(J) +P(I,J)
836 IF I = 0 THEN P(I,J) = -P(I,J)
840 NEXT I
845 P(N0,J +1) = 0
850 IF A(J) <0 THEN A(J) = A(J) +10:P(N0,J +1) = -1
865 NEXT J
868 IF P(N0,S0) = 0 THEN GOTO 900
870 X7 = P(1,S0 -1):P(1,S0 -1) = P(0,S0 -1):P(0,S0 -1) = X7
875 IF P(N0,S0 -1) = 0 THEN GOTO 895
890 IF P(0,S0 -1) >0 THEN P(0,S0 -1) = P(0,S0 -1) -1
892 IF P(1,S0 -1) <9 THEN P(1,S0 -1) = P(1,S0 -1) +1
895 A(S0 -1) = P(1,S0 -1) +P(2,S0 -1) -P(0,S0 -1)
900 REM DISPLAY
905 FOR I = 0 TO N0 -1
906 VTAB 12 +N0 -1 -2 *I
910 FOR J = 0 TO S0 -1
912 HTAB 20 +S0 -2 *J
915 PRINT P(I,J);
920 NEXT J
921 IF S0 = 1 THEN 929
922 FOR J = S0 -1 TO 1 STEP -1: HTAB 20 +S0 -2 *J
924 IF P(I,J) < >0 THEN 929
925 PRINT " ";: NEXT J
929 NEXT I
930 VTAB 12 +N0: HTAB 20 -S0 -1
935 FOR J = 0 TO S0: PRINT "--";: NEXT J
945 VTAB 12 +N0 +1: HTAB 20 -S0 -7: PRINT "ANSWER"
950 VTAB 12 +N0 -1: HTAB 20 -S0: PRINT "-"
999 RETURN
1000 REM DRILL AND PRACTICE
1005 GOSUB 700: REM INIT DRILL
1010 FOR P = 1 TO M9
1015 X3 = FRE(0): REM HOUSE CLEANING
1020 GOSUB 800: REM SET UP A PROBLEM
1030 GOSUB 600: REM GO THROUGH A PROBLEM
1040 NEXT P
1099 RETURN
1100 REM OPEN/APPEND PROCEDURE
1105 PRINT
1110 PRINT D$;"APPEND ";N$
1120 PRINT D$;"WRITE ";N$
1129 RETURN
1150 REM CLOSE FILE PROCEDURE
1151 PRINT
1155 PRINT D$;"CLOSE ";N$
1159 RETURN
1200 REM PAUSE PROCEDURE
1210 FOR Z7 = 0 TO 1500: NEXT Z7
1219 RETURN
2000 REM MAIN PROCEDURE
2010 GOSUB 2800: REM GET STUDENT NAME AND SET UP DATA FILE
2020 GOSUB 1000: REM DRILL PROCEDURE
2030 GOSUB 3000: REM STUDENT WRAPUP
2040 HOME : VTAB 10: PRINT "IS THEIR ANOTHER STUDENT TO TAKE THIS"
2045 PRINT "DRILL (Y/N)? ";: GET A$: PRINT A$: HOME
2050 IF A$ = "Y" THEN 2000
2055 IF A$ < >"N" THEN 2040
2099 RETURN
2800 : REM STUDENT SET UP
2810 HOME : VTAB 10: PRINT "PLEASE ENTER YOUR NAME"
2812 HTAB 10: PRINT "THEN PRESS 'RETURN'": PRINT
2815 INPUT N$
2820 PRINT D$;"OPEN ";N$
2822 PRINT D$;"WRITE ";N$
2823 PRINT N$
2824 PRINT M9: PRINT N0: PRINT S0
2826 PRINT D$;"CLOSE ";N$
2830 FOR I = 0 TO 4:E(I) = 0: NEXT I
2899 RETURN
3000 REM STUDENT WRAPUP
3010 HOME : VTAB 3: PRINT "DRILL RESULTS FOR ";N$: PRINT : PRINT
3011 PRINT D$;"OPEN ";N$;".FINAL"
3012 PRINT D$;"WRITE ";N$;".FINAL"
3014 PRINT "F,";M9
3016 PRINT X5: FOR K2 = 0 TO 3: PRINT E(K2): NEXT K2
3019 PRINT D$;"CLOSE ";N$;".FINAL"
3020 PRINT M9 -X5;" PROBLEMS CORRECT OUT OF ";M9: PRINT
3030 PRINT "THAT'S "; INT(100 *(M9 -X5)/M9);"%": PRINT
3040 PRINT : PRINT : PRINT
3050 PRINT "ERRORS FIRST RETRY ": PRINT
3060 PRINT "ANSWER";: HTAB 13: PRINT E(1);: HTAB 23: PRINT E(3): PRINT
3080 GOSUB 1200: PRINT : PRINT
3090 PRINT "ANY KEY TO CONTINUE";: GET A$: PRINT A$: HOME
3099 RETURN
4000 REM MARQUE
4001 HOME
4010 VTAB 2:A$ = "ARITHMETIC DRILL AND PRACTICE": GOSUB 4100
4020 VTAB 5:A$ = "COPYRIGHT (C) 1982 - J. BEIDLER": GOSUB 4100
4025 VTAB 7:A$ = "ALL RIGHTS RESERVED": GOSUB 4100
4029 GOSUB 1200
4090 GOSUB 1200: GOSUB 1200: GOSUB 1200
4099 RETURN
4100 REM CENTER ON GIVEN LINE
4110 X3 = LEN(A$)
4120 HTAB 20 -(X3/2)
4130 PRINT A$
4199 RETURN
7000 REM SOUND ROUTINE
7001 GOSUB 8000
7005 REM POKE6,TONE:POKE 7,TIME:CALL768
7010 POKE 768,173: POKE 769,48: POKE 770,192: POKE 771,136: POKE 772,208: POKE 773,4: POKE 774,198: POKE 775,7: POKE 776,240: POKE 777,8:
7020 POKE 778,202: POKE 779,208: POKE 780,246: POKE 781,166: POKE 782,6: POKE 783,76: POKE 784,0: POKE 785,3: POKE 786,96
7030 RETURN
7099 RETURN
7100 REM SOUND CORRECT
7105 IF S$ < >"Y" THEN RETURN
7110 POKE 6,15: POKE 7,30: CALL 768: RETURN
7150 REM SOUND INCORRECT
7155 IF S$ < >"Y" THEN RETURN
7160 POKE 6,150: POKE 7,50: CALL 768: RETURN
7800 REM TEACHER SET UP
7809 VTAB 8
7810 PRINT "NUMBER OF DIGITS PER NUMBER (1-8)? ";
7811 GET A$: PRINT A$: IF (A$ <"1") OR (A$ >"8") THEN 7810
7812 S0 = ASC(A$) - ASC("0")
7815 N0 = 2
7821 PRINT
7822 PRINT "NUMBER OF RETRIES PER DIGIT (0-9)? ";
7823 GET A$: PRINT A$: IF (A$ <"0") OR (A$ >"9") GOTO 7823
7824 R9 = ASC(A$) - ASC("0")
7825 PRINT
7826 INPUT "PROBLEMS PER DRILL (THEN 'RETURN')? ";M9
7830 C$ = "N"
7831 PRINT : PRINT
7832 PRINT "AUDIO FEEDBACK (Y/N)? ";: GET S$: PRINT S$;
7834 IF (S$ < >"Y") AND (S$ < >"N") THEN 7832
7840 PRINT : PRINT
7865 INVERSE : PRINT "INFORMATION CORRECT (Y/N)?";: NORMAL
7868 GET A$: PRINT A$;
7875 IF A$ = "Y" THEN PRINT : RETURN
7878 IF A$ < >"N" THEN HTAB 1: GOTO 7865
7880 HOME : GOSUB 7900: GOTO 7800
7899 RETURN
7900 REM BANNER
7910 INVERSE : FOR I = 2 TO 6
7920 VTAB I: FOR J = 8 TO 31
7930 HTAB J: PRINT " ";: NEXT J: NEXT I
7940 PRINT
7950 A$ = "SUBRACTION DRILL": VTAB 3: HTAB 12: PRINT A$
7960 A$ = "TEACHER INITIALIZATION": VTAB 5: HTAB 9: PRINT A$
7995 NORMAL
7999 RETURN
8000 REM TEACHER INITIALIZATION
8005 D$ = "<CTRL-D>": REM D$ = CNTL-D
8010 HOME
8020 GOSUB 7900: REM HEADLINE
8030 GOSUB 7800: REM SET UP
8099 RETURN
9000 REM DATA DIRECTORY
9001 REM A$ - GEN'L PURPOSE USE IN GET
9002 REM A(7) - ANSWER ARRAY
9003 REM C(7) - CARRY ARRAY
9004 REM D$ - CNTL-D
9008 REM E(4) - ERROR COUNTS 0-CARRY, 1-ANSWER, 2-CARRY RETRY, 3-ANSWER RETRY
9010 REM M9 - NO. OF PROBLEMS PER DRILL
9019 REM N$ - STUDENT7S NAME
9020 REM N0 - NO. OF NUMBERS TO ADD PER PROBLEM
9024 REM P - COUNT OF PROBLEM NUMBER
9025 REM P(6,7) - 2-D ARRAY OF THE PROBLEM
9030 REM S0 - SIZE OF EACH NUMBER
20000 REM SYSTEM CHART
20010 REM
20020 REM 1 - MAIN DRIVER
20030 REM 7000 - INITIALIZE
20040 REM 7900 - BANNER
20050 REM 7800 - TEACHER INPUT
20060 REM 2000 - MAIN PROCESS
20070 REM 2800 - INIT STUDENT FILE
20080 REM 1000 - DRILL PROCEDURE
20090 REM 700 - INIT DRILL VARIABLES
20100 REM 800 - MAKE UP AND PRINT THE PROBLEM
20110 REM 600 - DRILL LOOP
20120 REM 500 - ERROR IN ANSWER
20130 REM 300 - PROBLEM TO FILE
20140 REM 400 - ERROR IN CARRY
20150 REM 300 - PROBLEM TO FILE
20160 REM